Skip to content

Adjust Omit's 2nd param to allow autocompletion of 1st param's keys#43768

Closed
EvanLovely wants to merge 1 commit into
microsoft:masterfrom
EvanLovely:patch-2
Closed

Adjust Omit's 2nd param to allow autocompletion of 1st param's keys#43768
EvanLovely wants to merge 1 commit into
microsoft:masterfrom
EvanLovely:patch-2

Conversation

@EvanLovely

Copy link
Copy Markdown

Consider this code example when using Omit:

type Person = { 
  firstName: string; 
  lastName: string;
}
type X = Omit<Person, 'lastName'>;

Before, no autocompletion would happen when typing out 'lastName' and after this PR it does autocomplete the keys from Person.

Have a nice day! 👋

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Apr 21, 2021
@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@tjjfvi

tjjfvi commented Apr 21, 2021

Copy link
Copy Markdown
Contributor

This is a breaking change; Omit<{ foo: 1 }, "bar"> being valid and a no-op is likely highly relied on

@AviVahl

AviVahl commented Apr 22, 2021

Copy link
Copy Markdown
Contributor

See discussion at #30825

@EvanLovely

Copy link
Copy Markdown
Author

Makes sense; thanks for insight 👍

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants